package calculator;

import java.util.Arrays;
import java.util.List;

public class ExpressionTokenizer {

	private ExpressionValidator validator;
	
	public ExpressionTokenizer(ExpressionValidator validator) {
		super();
		this.validator = validator;
	}

	public List<String> split(String expression) {
		validator.validate(expression);
		expression = expression.trim();
		String [] tks = expression.split(" ");
		return Arrays.asList(tks);
	}

}
